#include <fstream>
#include <iostream>
#include <string>
#include <cmath>

using namespace std;

int main()
{
  int beta=2;
  int p=3;
  int L=-1;
  int U=1;
  double ufl;
  double ofl;
  int s;
  int i;
  int j;
  int k;
  
  ufl=pow(beta,L);
  ofl=pow(beta,U)*(beta-pow(beta,1-p));
  cout<<"UFL"<<":"<<ufl<<endl;
  cout<<"OFL"<<":"<<ofl<<endl;
  
  int fpn[6];
  fpn[1]=1;
  fpn[4]=2;
  s=0;
  ofstream pB1;
  pB1.open("pB1.txt", std::ios::out);
  for (i=-1;i<=1;i++)
    {
      for (j=0;j<=1;j++)
	{
	  for (k=0;k<=1;k++)
	    {
	      fpn[2]=j;
	      fpn[3]=k;
	      fpn[5]=i;
	      s=s+2; 
             if (!pB1.is_open())
                 return 0;
	       fpn[6]=0;
               pB1 << fpn <<endl;
	       fpn[6]=1;
	       pB1 << fpn <<endl;

	    }

	}
    }
  pB1 << 0 <<endl;
  s=s+1;
  pB1.close();
  
    cout<<"s="<<s<<endl;
    int coro_s;
    coro_s=pow(2,p)*(U-L+1)+1;
    cout<<"coro_s="<<coro_s<<endl;

    int subfpn[7];
  subfpn[1]=0;
  subfpn[5]=2;
  subfpn[6]=-1;
  ofstream pB2;
  pB2.open("pB2.txt", std::ios::out);
  for (i=0;i<=1;i++)
    {
      for (j=0;j<=1;j++)
	{
	  for (k=0;k<=1;k++)
	    {
	      fpn[2]=i;
	      fpn[3]=j;
	      fpn[4]=k;
             if (!pB2.is_open())
                 return 0;
	       subfpn[7]=0;
               pB2 << subfpn <<endl;
	       subfpn[7]=1;
	       pB2 << subfpn <<endl;

	    }

	}
    }
  pB2.close();
  
}
